package com.yitianyigexiangfa.netty.protocol.oio;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;

public class ConnectThread implements Runnable {

    private  String host = "192.168.3.152";
    private int port = 8081;


    public void run() {
        try {
            Socket client = new Socket(host, port);
            OutputStream os = client.getOutputStream();
            os.write(10);
            os.flush();
            Thread t = Thread.currentThread();
            String threadName = "" + client.getInetAddress() + client.getLocalPort();
            System.out.println(threadName);
            final double d = Math.random();
            while (true) {
                // 占用线程资源
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
